<template>
    <div class="audit">
        <div class="done" v-if="state ==2">
            <Icon type="md-checkmark-circle" color='#fc9153'/>
            <div class="text">认证通过</div>
        </div>
        <div class="error" v-if="state ==3">
            <Icon type="ios-close-circle" color="#ed4014"/>
            <div class="text">认证失败</div>
            <div class="date">{{reviewDate}}</div>
            <div class="reason">原因：{{failReason}}</div>
            <div class="btn" @click="btn">重新提交</div>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            state:null,//状态
            reviewDate:'',//审核时间
            failReason:'',//原因
        }
    },
    computed: {
        baseUrl() {
            return "http://192.168.1.132:8082";
        },
    },
    methods:{
        //审核失败时查询资料信息
        getInfo(){
            this.$http.get(this.baseUrl + '/userApplyBA/findUserBusiness/'+this.$route.query.uid).then(data=>{
                console.log(data)
                this.state = data.data.state;
                if(this.state ==3){
                    this.reviewDate = data.data.reviewDate
                    this.failReason = data.data.failReason
                }
            }).catch(err=>{
                console.log('网络连接失败！')
            });
        },
        //重新提交
        btn(){
            let query ={type:'audit'}
            this.$router.push({
                name:'home',
                query:query
            })
        }
    },
    mounted(){
        this.getInfo()
    }

}</script>

<style lang="less">
    .audit{
        .done,.error{
            // width: 0.96rem;
            margin-top: 1rem;
            text-align: center;
            i{
                font-size: 0.96rem;
            }
            .text{
                text-align: center;
                font-size: 0.36rem;
                line-height: 0.72rem;
                padding-top: 0.2rem;
            }
            .date,.reason{
                font-size: 0.24rem;
                line-height: 0.36rem;
                margin-bottom: 0.2rem;
            }
            .reason{
                margin-bottom: 1rem;
            }
            .btn {
                width: 5.8rem;
                height: 0.86rem;
                line-height: 0.86rem;
                margin: 0 auto 0.3rem;
                background: rgba(73, 76, 90, 1);
                border-radius: 6px;
                text-align: center;
                font-size: 0.3rem;
                font-family: SourceHanSansCN-Normal;
                font-weight: 400;
                color: rgba(255, 255, 255, 1);
            }
        }
    }
</style>
